﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MoneyWentWhere.OutputHelpers
{
    public class DisplayConverterAttribute : DisplayConverterBaseAttribute
    {
        public DisplayConverterAttribute(Type converterType) : base(converterType) { }
    }

    public class HeaderDisplayConverterAttribute : DisplayConverterBaseAttribute 
    {
        public HeaderDisplayConverterAttribute(Type converterType) : base (converterType) { }
    }

    [AttributeUsage(AttributeTargets.Field)]
    public abstract class DisplayConverterBaseAttribute : Attribute
    {
        public Type ConverterType;
        public DisplayConverterBaseAttribute(Type converterType)
        {
            if (converterType == null) { throw new ArgumentNullException("converterType"); }
            if (!typeof(DisplayConverter).IsAssignableFrom(converterType))
            {
                throw new ArgumentException("converterType not derived from ConverterToString");
            }
            ConverterType = converterType;
        }
    }

}
